-- stimulate
-- created by zhuangsl
-- 亢奋状态

return {
    fetchProps = function(who, status, condition)
        local props    = {};
        local endRound = condition["end_round"];

        -- 攻击、魔力百分比提升
        local propId = PropM.getPropId("attrib");
        local value  = condition["value"];
        table.insert(props, { propId, "attack", value, endRound, });
        table.insert(props, { propId, "magic", value, endRound, });

        -- 降低所受伤害
        propId = PropM.getPropId("damage");
        table.insert(props, { propId, "defense", 50, endRound, });

        return props;
    end,

    fireEvent = function(target, status, condition, eventType)
        if eventType == "clear" then
            EventMgr.fire(event.NEED_REFRESH_ATTRIB, {});
        end
    end,

    desc = function(who, status, condition)
        -- 获取状态描述
        local cfg = CombatStatusM.getStatusInfo(status);
        local desc = cfg.desc;

        -- 攻击提升
        local value = condition["value"];
        value = math.modf(value / 10);
        desc = string.gsub(desc, "{value}", value);

        -- 降低所受伤害
        desc = string.gsub(desc, "{rate}", 5);

        return desc;
    end,
};
